/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package sll;
/**
*
* @author mweya
*/
public class Node <AnyType> {
private AnyType data;
private Node next;
Node(AnyType data, Node next){
this.data = data;
this.next = next;
}
Node(AnyType data) {
this.data = data;
this.next = null;
}
Node() {
this.data = null;
this.next = null;
}
public AnyType getData() {
return this.data;
}
public Node getNext() {
return this.next;
}
public void setData(AnyType data) {
this.data = data;
}
public void setNext(Node next) {
this.next = next;
}
@Override
public String toString() {
return "Node =(data="+data+", next="+next+")";
}
}